<html>
<head><meta charset="utf-8"><title>added new intrinsic, can&#x27;t build libcore · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/added.20new.20intrinsic.2C.20can&#x27;t.20build.20libcore.html">added new intrinsic, can&#x27;t build libcore</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="204516826"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/added%20new%20intrinsic%2C%20can%27t%20build%20libcore/near/204516826" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Oliver Giersch <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/added.20new.20intrinsic.2C.20can&#x27;t.20build.20libcore.html#204516826">(Jul 21 2020 at 06:53)</a>:</h4>
<p>Hi, I've added code for generating a new atomic intrinsic to <code>librustc_llvm_codegen/intrinsic.rs</code> (or rather a new success/failure ordering combination for <code>cxchg</code>) and added the corresponding intrinsic signature to <code>libcore/intrinsics.rs</code> and usage to <code>libcore/sync/atomic.rs</code>.<br>
However, with changes to both <code>llvm_codegen</code> and <code>libcore</code> the stage-1 build of libstd (and libcore I assume) fails.<br>
From my understanding of the bootstrapping process, this should be caused by the beta compiler used in stage-1 being unable to compile the changes made to <code>libcore</code> because it is lacking the changes to <code>llvm_codegen</code>.<br>
How do I go about this? Do I have to first try to get the changes to codegen merged and only then the changes to core?</p>



<a name="204521353"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/added%20new%20intrinsic%2C%20can%27t%20build%20libcore/near/204521353" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/added.20new.20intrinsic.2C.20can&#x27;t.20build.20libcore.html#204521353">(Jul 21 2020 at 08:08)</a>:</h4>
<p>You can use <code>#[cfg(bootstrap)]</code> and <code>#[cfg(not(bootstrap))]</code> to only enable or disable code in libcore when compiling using the bootstrap compiler.</p>



<a name="204523524"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/added%20new%20intrinsic%2C%20can%27t%20build%20libcore/near/204523524" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Oliver Giersch <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/added.20new.20intrinsic.2C.20can&#x27;t.20build.20libcore.html#204523524">(Jul 21 2020 at 08:37)</a>:</h4>
<p><span class="user-mention silent" data-user-id="133247">bjorn3</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/added.20new.20intrinsic.2C.20can't.20build.20libcore/near/204521353">said</a>:</p>
<blockquote>
<p>You can use <code>#[cfg(bootstrap)]</code> and <code>#[cfg(not(bootstrap))]</code> to only enable or disable code in libcore when compiling using the bootstrap compiler.</p>
</blockquote>
<p>Thanks for the hint, I hadn't seen anything in the contribution guide about this attribute. I would assume these tend to get phased out over time?</p>



<a name="204523614"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/added%20new%20intrinsic%2C%20can%27t%20build%20libcore/near/204523614" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/added.20new.20intrinsic.2C.20can&#x27;t.20build.20libcore.html#204523614">(Jul 21 2020 at 08:38)</a>:</h4>
<p>We compile the stage 1 compiler using the current beta release (mostly i think)</p>



<a name="204523652"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/added%20new%20intrinsic%2C%20can%27t%20build%20libcore/near/204523652" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/added.20new.20intrinsic.2C.20can&#x27;t.20build.20libcore.html#204523652">(Jul 21 2020 at 08:39)</a>:</h4>
<p>after every new beta release, we use the new beta compiler for bootstrap, which means that we can now remove all previous <code>#[cfg(bootstrap)]</code> annotations</p>



<a name="204523686"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/added%20new%20intrinsic%2C%20can%27t%20build%20libcore/near/204523686" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/added.20new.20intrinsic.2C.20can&#x27;t.20build.20libcore.html#204523686">(Jul 21 2020 at 08:39)</a>:</h4>
<p>see <a href="https://github.com/rust-lang/rust/pull/74395">https://github.com/rust-lang/rust/pull/74395</a> where this was done the last time</p>



<a name="204523819"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/added%20new%20intrinsic%2C%20can%27t%20build%20libcore/near/204523819" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/added.20new.20intrinsic.2C.20can&#x27;t.20build.20libcore.html#204523819">(Jul 21 2020 at 08:41)</a>:</h4>
<p>(every new beta is mostly just the nightly compiler of that given day, so it contains all relevant changes)</p>



<a name="204523930"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/added%20new%20intrinsic%2C%20can%27t%20build%20libcore/near/204523930" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/added.20new.20intrinsic.2C.20can&#x27;t.20build.20libcore.html#204523930">(Jul 21 2020 at 08:42)</a>:</h4>
<p>also see <a href="https://rustc-dev-guide.rust-lang.org/building/bootstrapping.html">https://rustc-dev-guide.rust-lang.org/building/bootstrapping.html</a></p>



<a name="204524324"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/added%20new%20intrinsic%2C%20can%27t%20build%20libcore/near/204524324" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Oliver Giersch <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/added.20new.20intrinsic.2C.20can&#x27;t.20build.20libcore.html#204524324">(Jul 21 2020 at 08:48)</a>:</h4>
<p>I see, sorry for asking, I should have read the guide more carefully</p>



<a name="204524439"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/added%20new%20intrinsic%2C%20can%27t%20build%20libcore/near/204524439" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/added.20new.20intrinsic.2C.20can&#x27;t.20build.20libcore.html#204524439">(Jul 21 2020 at 08:49)</a>:</h4>
<p>don't mind <span aria-label="thumbs up" class="emoji emoji-1f44d" role="img" title="thumbs up">:thumbs_up:</span></p>



<a name="204524705"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/added%20new%20intrinsic%2C%20can%27t%20build%20libcore/near/204524705" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/added.20new.20intrinsic.2C.20can&#x27;t.20build.20libcore.html#204524705">(Jul 21 2020 at 08:52)</a>:</h4>
<p>its often far easier to search things if you know what to search for, so this taking me 5 minutes while waiting for stuff to compile isn't something which should prevent you from asking in the future</p>



<a name="204524770"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/added%20new%20intrinsic%2C%20can%27t%20build%20libcore/near/204524770" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/added.20new.20intrinsic.2C.20can&#x27;t.20build.20libcore.html#204524770">(Jul 21 2020 at 08:53)</a>:</h4>
<p>i also think that questions like this may often end up being somewhat interesting to other people as well</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>